﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ManageTicket.Tools
{
    public partial class frmItemDetail : Form
    {
        public frmItemDetail(int id)
        {
            InitializeComponent();
            ID = id;
        }

        private int ID;

        private void frmItemDetail_Load(object sender, EventArgs e)
        {
            try
            {
                Business.Item boItem = new Business.Item();
                Business.Employee boEmp = new Business.Employee(); 
                DataObjects.Item oItem = boItem.GetObjectByPK(ID);
                if (oItem != null)
                {
                    dtpDateInput.Value = oItem.DateInput.Value;
                    DataObjects.Employee oEmp = boEmp.GetObjectByPK(oItem.EmployeeId);
                    if (oEmp != null)
                        txtFullName.Text = oEmp.LastName + " " + oEmp.FirstName;
                    txtTitle.Text = oItem.Title;
                    txtRemark.Text = oItem.Remark;
                }
            }
            catch (Exception ex)
            {
                
                //throw ex;
            }
            
        }
    }
}
